import * as webpack from 'webpack';
import * as CompressionWebpackPlugin from 'compression-webpack-plugin';
import * as merge from 'webpack-merge';
import BaseConfig from './webpack.config';
import { appBuild } from "./paths";

const config = merge(BaseConfig, {
	mode: 'production',
	devtool: "hidden-source-map",
	output: {
		path: appBuild,
		filename: 'js/[name].js'
	},
	plugins: [
		new webpack.DefinePlugin({
			"process.env": {
				NODE_ENV: JSON.stringify('production')
			}
		}),
		// new CompressionWebpackPlugin({
		// 	asset: '[path].gz[query]',
		// 	algorithm: 'gzip',
		// 	test: /\.(js|css)/,
		// 	threshold: 1024,
		// 	minRatio: 0.8
		// })
	]
})

export default config;